package com.cyufeng.blog.controller;

import com.cyufeng.blog.dto.HotArticleDto;
import com.cyufeng.blog.service.HotArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 热门文章
 * @author Cyufeng
 * Data:2019.1.12
 */
@CrossOrigin
@RequestMapping("/blog/hotArticle")
@RestController
public class HotArticleController {
    @Autowired
    HotArticleService hotArticleService;
    /**
     * 查询所有热门文章
     */
    @GetMapping("/getAllHotArticle")
    public List<HotArticleDto> getAllHotArticle(){

        return hotArticleService.getAllHotArticle();
    }

    /**
     * 查询所有热门工具
     */
    @GetMapping("/getAllHotTool")
    public List<HotArticleDto> getAllHotTool(){

        return hotArticleService.getAllHotTool();
    }

}
